/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.fgv.tcc.fgv.imovel.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author diego
 */
@Entity
@Table(name = "programa")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Programa.findAll", query = "SELECT p FROM Programa p"),
    @NamedQuery(name = "Programa.findByCodigo", query = "SELECT p FROM Programa p WHERE p.codigo = :codigo"),
    @NamedQuery(name = "Programa.findByNome", query = "SELECT p FROM Programa p WHERE p.nome = :nome"),
    @NamedQuery(name = "Programa.findByXhtml", query = "SELECT p FROM Programa p WHERE p.xhtml = :xhtml"),
    @NamedQuery(name = "Programa.findByMbean", query = "SELECT p FROM Programa p WHERE p.mbean = :mbean"),
    @NamedQuery(name = "Programa.findByAjuda", query = "SELECT p FROM Programa p WHERE p.ajuda = :ajuda"),
    @NamedQuery(name = "Programa.findByTitulo", query = "SELECT p FROM Programa p WHERE p.titulo = :titulo")})
public class Programa implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue
    @Column(name = "codigo")
    private Integer codigo;
    @Size(max = 45)
    @Column(name = "nome")
    private String nome;
    @Size(max = 45)
    @Column(name = "xhtml")
    private String xhtml;
    @Size(max = 45)
    @Column(name = "mbean")
    private String mbean;
    @Size(max = 100)
    @Column(name = "ajuda")
    private String ajuda;
    @Size(max = 100)
    @Column(name = "titulo")
    private String titulo;
   

    public Programa() {
    }

    public Programa(Integer codigo) {
        this.codigo = codigo;
    }

    public Integer getCodigo() {
        return codigo;
    }

    public void setCodigo(Integer codigo) {
        this.codigo = codigo;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getXhtml() {
        return xhtml;
    }

    public void setXhtml(String xhtml) {
        this.xhtml = xhtml;
    }

    public String getMbean() {
        return mbean;
    }

    public void setMbean(String mbean) {
        this.mbean = mbean;
    }

    public String getAjuda() {
        return ajuda;
    }

    public void setAjuda(String ajuda) {
        this.ajuda = ajuda;
    }

    public String getTitulo() {
        return titulo;
    }

    public void setTitulo(String titulo) {
        this.titulo = titulo;
    }

   

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigo != null ? codigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Programa)) {
            return false;
        }
        Programa other = (Programa) object;
        return (this.codigo != null || other.codigo == null) && (this.codigo == null || this.codigo.equals(other.codigo));
    }

    @Override
    public String toString() {
        return "br.com.fgv.tcc.fgv.imovel.model.Programa[ codigo=" + codigo + " ]";
    }
    
}
